package cate.game.videohall.vo;

import cate.game.videohall.po.VideoGroupPO;
import cate.game.videohall.po.VideoPO;
import easy.java.dev.note.NoteClass;
import easy.java.dev.note.NoteField;

import java.util.ArrayList;
import java.util.List;
import java.util.Set;

@NoteClass("VideoGroupVO")
public class VideoGroupVO {

	@NoteField(value = "分组")
	public int group;

	@NoteField(value = "录像")
	public List<VideoVO> list = new ArrayList<>();

	public VideoGroupVO() {
	}

	public VideoGroupVO(VideoGroupPO vg, Set<String> collectUids) {
		this.group = vg.group;
		if (vg.list != null) {
			for (VideoPO vp : vg.list) {
				VideoVO vo = new VideoVO(vp);
				vo.collect = collectUids.contains(vo.replayProfile.replayUid);
				list.add(vo);
			}
		}
	}
}
